<template>
  <div class="box hide-scroller-bar" @scroll="loadImg($event)" ref="pageRef">
    <a-row class="text-center" justify="center">
      <a-col :span="24" class="title-top">
        <a-col class="title" v-if="config.basic && config.basic.system_name">
          <span>
            {{
              aiTxt
                ? config.basic.system_name.slice(0, -2)
                : config.basic.system_name
            }}
          </span>
          <span class="ai-text">{{ aiTxt ? aiTxt : "AI" }}</span
          >绘画
        </a-col></a-col
      >
      <a-col :span="24" class="sub-title">
        一张图，一句话 ，AI灵感绘图，创造无限可能</a-col
      >
      <a-col :span="11" class="input-border">
        <a-row class="lin-height">
          <a-col class="select" v-if="engineList.length > 1">
            <a-dropdown :trigger="['click']">
              <a class="ss-dropdown-link" @click.prevent>
                <span style="color: black; font-size: 16px">{{
                  engineData.engine_name
                }}</span>
                <span class="icon" v-if="engineList.length > 1"
                  ><DownOutlined
                /></span>
              </a>
              <template #overlay v-if="engineList.length > 1">
                <a-menu>
                  <a-menu-item
                    v-for="item in engineList"
                    :key="item.id"
                    @click="menuClick(item)"
                  >
                    <a style="color: black">{{ item.engine_name }}</a>
                  </a-menu-item>
                </a-menu>
              </template>
            </a-dropdown>
          </a-col>
          <a-col class="line" v-if="engineList.length > 1"></a-col>
          <a-input
            v-model:value="searchValue"
            class="input"
            placeholder="搜索全站作品"
            @pressEnter="pressEnter"
          >
          </a-input>
        </a-row>
      </a-col>
      <a-col :span="24">
        <a-space :size="48">
          <div class="btn" @click="makingClick">开始制作</div>
          <div class="btn btn-bg" @click="exploreClick">探索AI新人必进</div>
        </a-space>
      </a-col>
    </a-row>
    <div style="padding: 0 30px">
      <a-row class="popularScenes">
        <a-col>
          <a-space>
            <span>
              <img
                src="../../../common/image/scene.png"
                style="width: 35px; height: 35px"
              />
            </span>
            <span class="title">热门场景</span>
          </a-space>
        </a-col>
        <a-col class="pointer" @click="seeMoreClick"
          >查看更多 <RightOutlined
        /></a-col>
      </a-row>
      <a-spin :spinning="hotScenseSpinning">
        <a-row class="scene-list" :wrap="false">
          <a-col
            class="list"
            v-for="item in hotScenseList"
            :key="item.id"
            @click="hotScenseClick(item.id)"
          >
            <div class="mask" />
            <img :src="item.image" class="image" />
            <span class="cont-txt"> {{ item.name }}</span>
          </a-col>
        </a-row>
      </a-spin>
      <a-row class="popularScenes">
        <a-col>
          <a-space>
            <span>
              <img
                src="../../../common/image/model.png"
                style="width: 35px; height: 35px"
              />
            </span>
            <span class="title">热门模型</span>
          </a-space>
        </a-col>
        <a-col class="pointer" @click="seeMoreClick"
          >查看更多 <RightOutlined
        /></a-col>
      </a-row>
      <a-row class="tag-list">
        <a-col
          class="tag"
          :class="tagId == item.id ? 'tag-list-bg' : ''"
          v-for="item in tagList"
          :key="item.id"
          @click="tagClick(item)"
          >{{ item.name }}</a-col
        >
      </a-row>
    </div>

    <!-- hotModelSpinning -->
    <div
      class="discover"
      v-masonry
      transition-duration="0.1s"
      item-selector=".discoveImg"
      id="discover-width"
      fit-width="true"
    >
      <div
        v-for="item in hotModelList"
        :key="item.id"
        class="discoveImg"
        v-masonry-tile
        :style="{
          width: imageWidth + 'px',
        }"
      >
        <div class="discoveTxt" @click.stop="makeTheSameModelClick(item)">
          <a-row class="bottom-text mask-right">
            <div class="icon-bg">
              <VerticalAlignBottomOutlined
                v-if="!item.downloadLoading"
                @click.stop="downloadClick(item)"
              />
              <LoadingOutlined v-else />
            </div>
            <div class="icon-bg" @click.stop="collectClick(item)">
              <HeartFilled
                v-if="item.collect && $store.getters.isLogin"
                style="color: red"
              />
              <HeartOutlined v-else />
            </div>
          </a-row>
          <div class="text-box">
            {{ item.title }}
          </div>
          <div class="make-box" @click.stop="makeTheSameModelClick(item)">
            创作
          </div>
        </div>
        <img
          v-if="item.images"
          v-lazy="
            item.images[0].webp ? item.images[0].webp : item.images[0].uri
          "
          :style="{
            width: imageWidth + 'px',
            height:
              imageWidth * (item.images[0].height / item.images[0].width) +
              'px',
          }"
        />
      </div>
    </div>
    <LoginModal
      :visible="loginVisible"
      @onClose="loginVisible = false"
      @loginCallback="loginCallback"
    />

    <!-- 回到顶部 -->
    <div class="back-to-top" v-show="headerFixed" @click.stop="backToTop">
      <ArrowUpOutlined />
    </div>
  </div>
</template>

<script>
import {
  defineComponent,
  ref,
  reactive,
  toRefs,
  computed,
  watch,
  toRaw,
  nextTick,
  onMounted,
} from "vue";
import {
  DownOutlined,
  RightOutlined,
  HeartOutlined,
  VerticalAlignBottomOutlined,
  LoadingOutlined,
  ArrowUpOutlined,
  HeartFilled,
} from "@ant-design/icons-vue";
import { useRoute, useRouter } from "vue-router";
import request from "../../../common/utils/request";
import { message } from "ant-design-vue";
import axios from "axios";
import store from "../../../store";
import moment from "moment";
import utils from "../../../common/utils/utils.js";
import defaultSetting from "../../../common/utils/defaultSetting";
import Masonry from "masonry-layout";

export default defineComponent({
  name: "paint",
  components: {
    DownOutlined,
    RightOutlined,
    HeartOutlined,
    VerticalAlignBottomOutlined,
    LoadingOutlined,
    ArrowUpOutlined,
    HeartFilled,
  },
  setup() {
    const route = useRoute();
    const router = useRouter();

    const state = reactive({
      count: 0,
      searchValue: "",
      tagId: 0,
      hotScenseList: [],
      hotScenseSpinning: false,
      hotModelList: [],
      hotModelSpinning: false,
      engineData: "",
      engineList: [],
      tagList: [],
      optionsSeach: [],
      searchId: 0,
      page: 1,
      pageSize: 20,
      isData: true,
      config: {},
      aiTxt: "",
      downloadLoading: true,
      loginVisible: false,

      headerFixed: false,
      pageRef: null,

      is_input: false,
      imageUrl: "",

      imageWidth: 0,
    });

    const tagClick = (item) => {
      // state.tagId = item.id;
      router.push({
        name: "SceneClassify",
        query: { id: item.id },
      });
    };
    // 场景
    const hotScenseClick = (id) => {
      router.push({
        name: "SceneClassify",
        query: { id },
      });
    };

    // 查看更多
    const seeMoreClick = () => {
      router.push({
        name: "SceneClassify",
      });
    };

    // 下拉加载

    const loadImg = (event) => {
      let el = event.target;
      if (Math.ceil(el.scrollTop + el.clientHeight) >= el.scrollHeight) {
        if (state.isData) {
          state.page++;
          getCaseList();
        }
      }

      if (el.scrollTop >= 500) {
        state.headerFixed = true;
      } else {
        state.headerFixed = false;
      }
    };

    const getCaseList = (title) => {
      state.hotModelSpinning = true;
      request
        .get("/work_ai", "/user/image/case/hotmodel/list", {
          page: state.page,
          pageSize: state.pageSize,
          title,
        })
        .then((res) => {
          if (res.result && res.result.data) {
            if (res.result.to == res.result.total) {
              state.isData = false;
            } else {
              state.isData = true;
            }
            res.result.data.forEach((item) => {
              item.downloadIng = true;
              item.collect = item.collection ? 1 : 0;
            });
            state.hotModelList = state.hotModelList.concat(res.result.data);

            nextTick(() => {
              document.getElementById("discover-width").style.marginLeft =
                "30px";
            });

            state.hotModelSpinning = false;
          }
        });
    };

    const init = () => {
      state.hotScenseSpinning = true;
      request.get("/work_ai", "/user/image/case/hotScenseList").then((res) => {
        state.hotScenseList = res.result;
        state.hotScenseSpinning = false;
      });

      request.get("/work_ai", "/user/image/engine/list").then((res) => {
        if (res.result) {
          state.engineData = res.result[0];
          state.engineList = res.result;
        }
      });
      request
        .get("/work_ai", "/user/image/tags/list", { isHotModel: 1 })
        .then((res) => {
          let list = [];
          res.result.forEach((item) => {
            if (item.tags) {
              list.push(...item.tags);
            }
          });
          state.tagList = list;
        });
      getCaseList();
      store.dispatch("GetConfigInfo").then((config) => {
        if (config && config.basic && config.basic.system_name) {
          if (
            config.basic &&
            config.basic.system_name.slice(-2) &&
            config.basic.system_name.slice(-2) == "AI"
          ) {
            state.aiTxt = config.basic.system_name.slice(-2);
          }
          state.config = config;
        }
      });
    };
    init();

    // 下拉选择
    const menuClick = (item) => {
      state.engineData = item;
    };

    // 输入框
    const searchChange = (value, label) => {
      state.searchId = label.id;
    };

    watch(
      () => state.searchValue,
      (val) => {
        if (!val) {
          state.searchId = 0;
          state.optionsSeach = [];
        }
      }
    );

    // 制作同款
    const makeTheSameModelClick = (item) => {
      utils.setStorage("caseInfo", JSON.stringify(item));
      let url = `${
        utils.isEnv() ? "http://localhost:4022" : defaultSetting.requestDomain
      }`;
      let link = url + `/#/workShotstack/aiCreation/drawDetail?id=${item.id}`;
      window.open(link);
    };

    const downloadClick = (item) => {
      if (item.images.length > 1) {
        // // 设置请求URL和参数
        const url = "/api/work_ai/user/image/case/download";
        const params = {
          caseId: item.id,
          org_id: store.getters.orgId,
        };
        item.downloadLoading = true;
        // 发送GET请求
        axios
          .get(url, {
            params,
            responseType: "blob", // 告诉axios要响应二进制数据类型
          })
          .then((response) => {
            // 创建Blob对象
            console.log(response, "responseresponse");
            const blob = new Blob([response.data], { type: "application/zip" });
            // 创建URL对象，并模拟点击链接进行下载
            const downloadUrl = URL.createObjectURL(blob);
            const link = document.createElement("a");
            link.href = downloadUrl;
            link.download =
              store.getters.orgId +
              item.id +
              moment(new Date()).format("YYYYMMDD"); // 下载文件名
            link.click();
          })
          .catch((error) => {
            setTimeout(() => {
              item.downloadLoading = false;
            }, 0);
          })
          .finally(() => {
            setTimeout(() => {
              item.downloadLoading = false;
            }, 0);
          });
      } else {
        var image = new Image();
        // 解决跨域 Canvas 污染问题
        // crossorigin 是HTML5中新增的<img>标签属性
        //anonymous:如果使用这个值的话就会在请求中的header中的带上origin属性，但请求不会带上cookie和其他的一些认证信息。
        //use-credentials:这个同时会在跨域请求中带上cookie和其他的一些认证信息。在使用这两个值时都需要server端在response的header中带上Access-Control-Allow-Credentials属性。可以通过server的配置文件来开启这个属性：server开启Access-Control-Allow-Credentials
        image.setAttribute("crossOrigin", "anonymous");
        image.onload = function () {
          var canvas = document.createElement("canvas");
          canvas.width = image.width;
          canvas.height = image.height;
          var context = canvas.getContext("2d");
          context.drawImage(image, 0, 0, image.width, image.height);
          var url = canvas.toDataURL("image/png");
          // 生成一个a元素
          var a = document.createElement("a");
          // 创建一个单击事件
          var event = new MouseEvent("click");
          // 将a的download属性设置为我们想要下载的图片名称，若name不存在则使用‘下载图片名称’作为默认名称
          a.download = item.images[0].origin_uri.substring(
            item.images[0].origin_uri.lastIndexOf("/") + 1
          );
          // 将生成的URL设置为a.href属性
          a.href = url;

          // 触发a的单击事件
          a.dispatchEvent(event);
        };
        image.src = item.images[0].uri;
      }
    };
    const collectClick = (item) => {
      utils.checkLogin().then((isLogin) => {
        if (!isLogin) {
          state.loginVisible = true;
          return;
        }
        if (item.collect) {
          console.log(item);
          request
            .del("/work_ai", "/user/image/case/collect/delete", {
              case_id: item.id,
              id: item.collect_id || item.collection.id,
            })
            .then((res) => {
              message.success("取消收藏成功！");
              item.collect = 0;
            });
        } else {
          request
            .post("/work_ai", "/user/image/case/collect/save", {
              case_id: item.id,
            })
            .then((res) => {
              message.success("收藏成功！");
              item.collect_id = res.id;
              item.collect = 1;
            });
        }
      });
    };

    // 输入框
    const pressEnter = () => {
      state.hotModelList = [];
      state.page = 1;
      state.pageSize = 20;
      getCaseList(state.searchValue);
    };

    // 开始制作
    const makingClick = () => {
      utils.checkLogin().then((isLogin) => {
        if (!isLogin) {
          state.loginVisible = true;
          return;
        }
        utils.removeStorage("caseInfo");
        let url = `${
          utils.isEnv()
            ? `http://localhost:${location.port}`
            : defaultSetting.requestDomain
        }`;
        let link = url + `/#/workShotstack/aiCreation/drawDetail`;
        window.open(link);
      });
    }
      //探索AI
      const exploreClick = () => {
      let url = `${
        utils.isEnv()
          ? `http://localhost:${location.port}`
          : defaultSetting.requestDomain
      }`;
      let link = url + `/#/exploreAi`;
      window.open(link);
    };

    // 回到顶部
    const backToTop = () => {
      nextTick(() => {
        state.pageRef.scrollTop = 0;
      });
    };

      onMounted(() => {
        state.imageWidth = Math.floor((document.body.clientWidth - 244 - 75) / 6);
      });
      const loginCallback = () => {
        state.loginVisible = false;
        router.go(0);
      };
      return {
        ...toRefs(state),
        tagClick,
        init,
        downloadClick,
        collectClick,
        makeTheSameModelClick,
        searchChange,
        menuClick,
        seeMoreClick,
        hotScenseClick,
        makingClick,
        pressEnter,
        loadImg,
        exploreClick,
        loginCallback,
  
        Masonry,
        backToTop,
      };
    },
  });
  </script>
  
  <style lang="less" scoped>
 .ss-dropdown-menu {
  background-color: rgba(0, 0, 0, 0);
  border-radius: 10px;
  margin-top: 5px;
  padding: 10px 0;
  box-shadow: none;
  left: -15px;
}

:deep(.ss-dropdown-menu-item:hover) {
  // border: 1px solid #fff;
  box-shadow: 0px 0px 22px 2px #fff;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.6);
}
:deep(.ss-dropdown-menu-item) {
  border: 1px solid rgba(0, 0, 0, 0);
  margin: 5px 0;
  font-size: 16px;
}
.box {
  width: 100%;
  height: 100%;
  overflow: hidden auto;
  background-image: url(../../common/image/home_bg.png);
  padding-bottom: 30px;
  background-size: 100%;

  :deep(.ss-input:focus) {
    //获取焦点
    outline: none !important;
    box-shadow: none !important;
  }
  input:focus {
    border: none;
    box-shadow: none;
  }
  .text-center {
    text-align: center;
  }
  .title-top {
    margin-top: 30px;
  }
  .title {
    font-size: 45px;
    font-weight: 700;
    letter-spacing: 2px;
    .ai-text {
      padding: 0 5px;
      font-weight: bold;
      color: rgb(255, 101, 98);
      line-height: 60px;
      background: linear-gradient(
        47deg,
        #6554ff 0%,
        #f26dbe 57.0068359375%,
        #febd7f 91.357421875%
      );
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }
  }
  .line {
    width: 1px;
    height: 29px;
    background: #999999;
    margin-top: 10px;
  }
  .input-border {
    width: 100%;
    height: 51px;
    border-radius: 24px;
    border: 1px solid rgb(255, 101, 98);
    // background: linear-gradient(7deg, #7a6cfc, #f26dbe, #febd7f, #fca450);
    .lin-height {
      line-height: 51px;
      padding-left: 10px;
    }
    .select {
      margin-left: 29px;
      margin-right: 20px;
      cursor: pointer;
      .icon {
        padding-left: 10px;
        color: black;
      }
    }
    .line {
      width: 1px;
      height: 29px;
      background: #999999;
      margin-top: 10px;
    }
    .input {
      flex: 1;
      height: 48px;
      border: none;
      background: none;
      margin-right: 18px;
    }
    :deep(.ss-select-single
        .ss-select-selector
        .ss-select-selection-search-input) {
      width: 100%;
      height: 48px;
      border: none;
      background: none;
    }
    :deep(.ss-select-single.ss-select-customize-input
        .ss-select-selector
        .ss-select-selection-placeholder) {
      position: absolute;
      right: 0;
      left: 0;
      padding: 10px 11px;
      color: #999;
    }
    .ss-input:focus {
      //获取焦点
      outline: none !important;
      box-shadow: none !important;
    }

    .placeholder {
      color: #999;
      position: absolute;
      right: 0;
      left: 50px;
      width: 100%;
    }
  }
  .ant-input:focus {
    //获取焦点
    outline: none !important;
    box-shadow: none !important;
  }

  .placeholder {
    color: #999;
    position: absolute;
    right: 0;
    left: 50px;
    width: 100%;
  }
}

.discover {
  position: relative;
}

.discoveImg {
  margin-right: 15px;
  margin-bottom: 15px;
  border-radius: 15px;
  position: absolute;
  // width: 16.6%;

  .discoveTxt {
    width: 90%;
    height: 95%;
    position: absolute;
    cursor: pointer;
    // display: none;

    .mask-right {
      position: absolute;
      right: 10px;
      bottom: 20px;
      width: 80px;
      height: 28px;
      background: rgba(0, 0, 0, 0.1);
      border-radius: 24px;
      backdrop-filter: blur(4px);
      display: flex;
      justify-content: space-around;
      align-items: center;

      .icon-bg {
        width: 25px;
        height: 25px;
        text-align: center;
        line-height: 25px;
        // background-color: #00000073;
        opacity: 0.8;
        border-radius: 50%;
        // margin-bottom: 10px;
        color: #fff;
        font-size: 16px;
        // background-image: linear-gradient(to bottom right, #938bff, #daaefe);
      }
      display: none;
    }

    .text-box {
      width: 90%;
      color: #cbd5e1;
      position: absolute;
      bottom: 80px;
      left: 5%;
      flex-direction: column;
      background: #0f121c;
      box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.5);
      border-radius: 8px;
      padding: 10px 12px 15px 12px;
      box-sizing: border-box;
      z-index: 2;
      display: none;
    }

    .make-box {
      color: #fff;
      padding: 8px 15px;
      position: absolute;
      top: 12px;
      right: 12px;
      background: #f1314e;
      border-radius: 50px;
      box-sizing: border-box;
      z-index: 2;
      display: none;
    }
  }

  img {
    border-radius: 12px;
    width: 100% !important;
    cursor: pointer;
    object-fit: cover;
  }
}

.discoveImg > .discoveTxt:hover {
  width: 100%;
  position: absolute;
  cursor: pointer;

  .text-box {
    display: block;
    min-height: auto;
    max-height: 81px;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .make-box {
    display: block;
  }

  .bottom-text {
    position: absolute;
    right: 0;
    width: 100%;
    // padding-right: 10px;
    display: flex;
    justify-content: flex-end;
    display: block;
  }
  .mask-right {
    position: absolute;
    right: 10px;
    bottom: 0px;
    width: 80px;
    height: 28px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 24px;
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: space-around;
    align-items: center;

    .icon-bg {
      width: 25px;
      height: 25px;
      text-align: center;
      line-height: 25px;
      // background-color: #00000073;
      opacity: 0.8;
      border-radius: 50%;
      // margin-bottom: 10px;
      color: #fff;
      font-size: 16px;
      // background-image: linear-gradient(to bottom right, #938bff, #daaefe);
    }
  }
}
.btn {
  width: 172px;
  height: 50px;
  background: linear-gradient(90deg, #7a6cfc, #f26dbe);
  border-radius: 25px;
  border: none;
  margin-top: 32px;
  cursor: pointer;
  color: #fff;
  line-height: 50px;
}

.btn-bg {
  background: linear-gradient(90deg, #78ffd7, #c3fe85);
  color: #000;
}
.popularScenes {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  .pointer {
    cursor: pointer;
    color: #999999;
  }
  .title {
    font-size: 23px;
    font-weight: 500;
    color: #333333;
  }
}
.tag-list {
  margin: 15px 0;
  .tag {
    cursor: pointer;
    background: #ffffff;
    border-radius: 5px;
    font-weight: 500;
    color: #7d89a0;
    padding: 7px 10px;
    // margin-left: 9px;
    margin-right: 10px;
    margin-bottom: 10px;
    border: 1px solid #fff;
  }
}

.tag-list :hover {
  border: 1px solid #8a6cf4;
  color: #8a6cf4;
  transition: all 0.6s;
}

.scene-list {
  width: 100%;
  margin-top: 22px;
  .list {
    cursor: pointer;
    width: 200px;
    height: 120px;
    text-align: center;
    line-height: 120px;
    opacity: 0.65;
    border-radius: 8px;
    margin-right: 10px;
    .mask {
      position: absolute;
      top: 2px;
      left: 0;
      width: 100%;
      text-align: center;
      padding-top: 120px;
      border-radius: 8px;
      background-color: #000;
      opacity: 0.7;
    }
    .cont-txt {
      position: absolute;
      top: 0;
      left: 50%;
      transform: translate(-50%);
      color: #fff;
    }
  }
  .image {
    width: 100%;
    height: 100%;
    border-radius: 9px;
  }
}

.scene-list .list:nth-last-child(1) {
  margin-right: 0px;
}
.scene-model-list {
  margin-top: 22px;

  .model-list {
    cursor: pointer;
    width: 305px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 16px;
    padding-bottom: 43px;
    .bottom-text {
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      height: 43px;
      line-height: 43px;
      padding: 0 20px;
      background: #fff;
      border-bottom-right-radius: 8px;
      border-bottom-left-radius: 8px;
      overflow: hidden; //超出隐藏
      white-space: nowrap; //不换行，同一行展示
      text-overflow: ellipsis; //设置超出部分以省略号展示
    }
    .mask {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 78%;
      text-align: center;
      padding-top: 120px;
      border-top-right-radius: 8px;
      border-top-left-radius: 8px;
      background-color: #00000073;
      opacity: 0.4;
      display: none;
    }
    .sameModel {
      background: linear-gradient(90deg, #938bff, #daaefe);
      border-radius: 3px;
      border: none;
      margin-top: 100px;
      display: none;
    }
    .mask-right {
      position: absolute;
      top: 30px;
      right: 20px;
      .icon-bg {
        width: 25px;
        height: 25px;
        text-align: center;
        line-height: 25px;
        border-radius: 50%;
        margin-bottom: 10px;
        color: #fff;
        background-image: linear-gradient(to bottom right, #938bff, #daaefe);
      }
    }

    .image {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 160px;
      border-top-right-radius: 9px;
      border-top-left-radius: 9px;
    }
    .main_image {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 158px;
      background-position: center;
      background-repeat: no-repeat;
      -webkit-background-size: cover;
      -moz-background-size: cover;
      background-size: cover;
      border-top-right-radius: 9px;
      border-top-left-radius: 9px;
    }
  }
}
.scene-model-list :hover {
  .mask {
    display: block;
  }
  .sameModel {
    display: block;
  }
  .mask-right {
    display: block;
  }
}

.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 0px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #000;
  z-index: 99;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 10px;
  cursor: pointer;
  font-size: 20px;
  font-weight: 800;
}

</style>
